/**
 * File: MapEntryWriter.java
 * Created by: mhaimel
 * Created on: 17 Aug 2009
 * CVS:  $Id: MapEntryWriter.java,v 1.1 2009/08/27 14:52:44 mhaimel Exp $
 */
package uk.ac.ebi.curtain.util.io;

import java.io.PrintWriter;

/**
 * @author mhaimel
 *
 */
public class MapEntryWriter extends AbstractWriter<MapEntryBean>{

	public MapEntryWriter(PrintWriter out) {
		super(out);
	}

	/* CtgID | ReadID | location | flagByte | Read Strand | AlignStrand | mapQual | SemQual | AltQual */
	@Override
	protected void _doWrite(MapEntryBean bean) {
		writeColumn(bean.getContigId());
		writeColumn(bean.getReadId());
		writeColumn(wrap(bean.getReferenceLocation()));
		writeColumn(wrap(bean.getFlag().getByteVal()));
		writeColumn(bean.getReadOrientation());
		writeColumn(bean.getAlignOrientation());
		writeColumn(bean.getCategory().toString());
		writeColumn(wrap(bean.getMapQual()));
		writeColumn(wrap(bean.getSemQual()));
		writeColumn(wrap(bean.getAltQual()));
		
		writeColumn(wrap(bean.getAlignLength()));
		_write(wrap(bean.getReadLocation()));
		getWriter().println();
	}
}
